Page({
    data: {
        foodname: "今天去哪家吃？",
        fooditems: [ "呀,今天哪家都不吃", "肯德基", "麦当劳", "百果园", "奈雪的茶", "瑞幸咖啡", "星巴克", "喜茶", "汉堡王" ],
        animate: !1,
        isclick: !1,
        dateMonth: [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ][new Date().getMonth()],
        dateDay: new Date().getDate(),
        dateWeek: [ "星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六" ][new Date().getDay()]
    },
    onLoad: function(e) {},
    onReady: function() {
        this.getTimeFood();
    },
    getTimeFood: function() {
        var e = this, t = new Date().getHours() + ":" + new Date().getMinutes();
        console.log(t), wx.request({
            url: "https://res.guqule.com/time.json?v=" + new Date().getMinutes(),
            method: "get",
            data: {},
            success: function(a) {
                console.log(a.data), a.data.map(function(a, i) {
                    (e.equalDate(t, a.start_time) || e.compareDate(a.start_time, t)) && e.compareDate(t, a.end_time) && e.setData({
                        foodname: a.text,
                        fooditems: a.menus
                    });
                }), "今天去哪家吃呢？" == e.foodname && (e.foodname = a.data[4].text, e.fooditems = a.data[4].menus);
            }
        });
    },
    compareDate: function(e, t) {
        var a = new Date(), i = e.split(":"), n = t.split(":");
        return a.setHours(i[0], i[1]) < a.setHours(n[0], n[1]);
    },
    equalDate: function(e, t) {
        var a = new Date(), i = e.split(":"), n = t.split(":");
        return a.setHours(i[0], i[1]) == a.setHours(n[0], n[1]);
    },
    rolledUp: function() {
        console.log(this.data.animate), this.data.animate || (this.setData({
            isclick: !0,
            animate: !0
        }), this.bbb(100, 10, 0));
    },
    bbb: function(e, t, a) {
        var i = this;
        i.setData({
            foodname: i.data.fooditems[Math.floor(Math.random() * i.data.fooditems.length)]
        }), i.timer = setInterval(function() {
            i.setData({
                foodname: i.data.fooditems[Math.floor(Math.random() * i.data.fooditems.length)]
            }), clearInterval(i.timer), i.timer = null, t > a ? i.bbb(e, t, a + 1) : i.setData({
                animate: !1
            });
        }, e);
    },
    gotoeleOtherApp1: function() {
        wx.navigateToMiniProgram({
            appId: "wx89752980e795bfde",
            path: "/pages/index/index?pub_id=16479&sid=gongjuxiang&act_id=16&source=jutuike"
        });
    },
    gotoPinOtherApp2: function() {
        wx.navigateToMiniProgram({
            appId: "wx89752980e795bfde",
            path: "/pages/index/index?pub_id=16479&sid=gongjuxiang&act_id=26&source=jutuike"
        });
    },
    gotoMeiOtherApp3: function() {
        wx.navigateToMiniProgram({
            appId: "wx89752980e795bfde",
            path: "/pages/index/index?pub_id=16479&sid=gongjuxiang&act_id=46&source=jutuike"
        });
    },
    gotomeiOtherApp4: function() {
        wx.navigateToMiniProgram({
            appId: "wx89752980e795bfde",
            path: "/pages/index/index?pub_id=16479&sid=gongjuxiang&act_id=38&source=jutuike"
        });
    },
    gotomeiOtherApp5: function() {
        wx.navigateToMiniProgram({
            appId: "wx89752980e795bfde",
            path: "/pages/index/index?pub_id=16479&sid=gongjuxiang&act_id=33&source=jutuike"
        });
    },
    gotomeiOtherApp6: function() {
        wx.navigateToMiniProgram({
            appId: "wx89752980e795bfde",
            path: "/pages/index/index?pub_id=16479&sid=gongjuxiang&act_id=32&source=jutuike"
        });
    },
    gotomeiOtherApp7: function() {
        wx.navigateToMiniProgram({
            appId: "wx89752980e795bfde",
            path: "/pages/index/index?pub_id=16479&sid=gongjuxiang&act_id=34&source=jutuike"
        });
    },
    gotomeiOtherApp8: function() {
        wx.navigateToMiniProgram({
            appId: "wx89752980e795bfde",
            path: "/pages/index/index?pub_id=16479&sid=gongjuxiang&act_id=37&source=jutuike"
        });
    },
    gotomeiOtherApp9: function() {
        wx.navigateToMiniProgram({
            appId: "wx89752980e795bfde",
            path: "/pages/index/index?pub_id=16479&sid=gongjuxiang&act_id=31&source=jutuike"
        });
    },
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {}
});